package com.zkk.service.impl;

import com.zkk.dao.CardDao;
import com.zkk.dao.impl.CardDaoImpl;
import com.zkk.pojo.Account;
import com.zkk.pojo.Card;
import com.zkk.service.CardService;

import java.math.BigDecimal;
import java.util.List;

public class CardServiceImpl implements CardService {
    CardDao cardDao = new CardDaoImpl();
    @Override
    public int addCard(Card card) {
        return cardDao.addCard(card);
    }

    @Override
    public List<Card> showAccount() {
        return cardDao.showAccount();
    }

    @Override
    public BigDecimal queryMoney(Card card) {
        System.out.println(card.getId_card());
        return cardDao.queryMoney(card).getBalance();
    }

    @Override
    public int rechargingMoney(String id_card, BigDecimal totalMoney) {
        return cardDao.rechargingMoney(id_card,totalMoney);
    }


}

